#include "PAP_defs.h"
#include "ADC_HAL_KA.h"
#include "GPIO_HAL_KA.h"
#include "TPM_HAL_KA.h"
#include "MC34671_Handler.h"

#define ADC_BUCK_OUTPUT_V   1   // Corresponding ADC channel and pin number 

#define BUCK_PWM_CHANNEL    0   // Corresponding PWM channel

#define BUCK_PWM_LIMIT  35

#define BUCK_OUTPUT_VOLTAGE_LOW     224

#define BUCK_OUTPUT_VOLTAGE_HIGH    230

#define ON  1
#define OFF 0

void vfnBuck_ADC_Init (void);

uint8 u8Buck_GetDutyCycle (void);

void vfnBuck_IncreaseDutyCycle (void); 

void vfnBuck_DecreaseDutyCycle (void);

void vfnBuck_PWM_Init (void);

uint8 u8Buck_IsDutyCycleMax (void);

uint16 u16Buck_GetOutputVoltage (void);

uint8 u8Buck_IsOutputLow (void);

uint8 u8Buck_IsOutputHigh (void);

void vfnBuck_TurnOn (void);

void vfnBuck_TurnOff (void);

void vfnBuck_RegulateVoltage (void);